<script lang="ts">
    import { InnerPopup } from "../Common/InnerPopup";
    import type { PopconfirmProps } from "./Popconfirm";

    let { visible = $bindable(), ...props }: PopconfirmProps = $props();
</script>

{#snippet title()}
    {@render props.icon?.()}
    <div class="cm-popconfirm-title-text">
        {#if typeof props.title === "function"}
            {@render props.title()}
        {:else}
            {props.title}
        {/if}
    </div>
{/snippet}

<InnerPopup {...props} bind:visible clsPrefix="cm-popconfirm" varName="popconfirm" theme={props.theme || "light"} confirm align={props.align || "top"} {title} showCancel={props.showCancel ?? true} />
